<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />

		<style type="text/css">
			.mui-numbox {
				position: absolute;
				right: 5px;
				top: 15px;
			}
			
			.mui-bar-tab .mui-tab-item.mui-active {
				color: #929292;
			}
			
			.mui-tab-item:first-child {
				border-right: 1px solid grey;
			}
			
			.mui-tab-item {
				background: #000;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		</header>
		<div class="mui-content">
			<div class="mui-slider">
				<div class="mui-slider-group">
					<div class="mui-slider-item">
						<img src="http://tulaoda.top/web/imgSource/images/yxrs.jpg" height="350px" />
					</div>
				</div>
			</div>
		</div>
		<div class="mui-row">
			<div class="mui-col-sm-6">
				<div class="mui-table-view-cell ">
					菜名：<span class="dname">鱼香肉丝</span>
				</div>
			</div>
			<div class="mui-col-sm-6" style="text-align: right;">
				<div class="mui-table-view-cell">
					价格：<span class="price">20</span>
				</div>
			</div>

		</div>
		<hr />
		<div class="mui-col-sm-6 mui-col-xs-12">
			<div class="mui-table-view-cell">
				介绍：<span class="description">付款绿山咖啡六十分抗衰老的福克斯的看法乐山大佛乐山大佛卡洛斯的咖啡连锁店开发商的开发商开发了</span>
			</div>
		</div>
		<!--底部栏-->
		<nav class="mui-bar mui-bar-tab">
			<a class="mui-tab-item" id="settlement">
				加入购物车
			</a>
		</nav>
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/model.js"></script>
		<script src="js/mui.min.js"></script>
		<script type="text/javascript">
			mui.init()
			mui.plusReady(function() {
				var id = Common.fn.getUrlParam('id');

				var result = Model.menu.getGoodById({
					id: id
				});
				$('.mui-slider-item').attr("src", result.menu.pic);
				$('.dname').text(result.menu.name);
				$('.price').text(result.menu.price);
				$('.description').text(result.menu.remark);
				console.log(id);

			});

			mui(".mui-bar-tab").on('tap', '.mui-tab-item', function() {
				var dishId = Common.fn.getUrlParam('id');
				var dname = $(".dname").text();
				console.log(dname + dishId);
				plus.storage.setItem(dishId + "", "{id:" + dishId + ",dname:'" + dname + "',num:1}");
				mui.toast('添加成功')
			})
		</script>
	</body>

</html>